3.4.5 \(\int (f+\frac {g}{x})^3 x^3 (a+b \log (c (d+e x)^n)) \, dx\) [305]

Optimal. Leaf size=149 \[ \frac {b (d f-e g)^3 n x}{4 e^3}-\frac {b (d f-e g)^2 n (g+f x)^2}{8 e^2 f}+\frac {b (d f-e g) n (g+f x)^3}{12 e f}-\frac {b n (g+f x)^4}{16 f}-\frac {b (d f-e g)^4 n \log (d+e x)}{4 e^4 f}+\frac {(g+f x)^4 \left (a+b \log \left (c (d+e x)^n\right )\right )}{4 f} \]

[Out]

1/4*b*(d*f-e*g)^3*n*x/e^3-1/8*b*(d*f-e*g)^2*n*(f*x+g)^2/e^2/f+1/12*b*(d*f-e*g)*n*(f*x+g)^3/e/f-1/16*b*n*(f*x+g
)^4/f-1/4*b*(d*f-e*g)^4*n*ln(e*x+d)/e^4/f+1/4*(f*x+g)^4*(a+b*ln(c*(e*x+d)^n))/f

________________________________________________________________________________________

Rubi [A]
time = 0.09, antiderivative size = 149, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 27, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.111, Rules used = {2459, 2442, 45} \begin {gather*} \frac {(f x+g)^4 \left (a+b \log \left (c (d+e x)^n\right )\right )}{4 f}-\frac {b n (d f-e g)^4 \log (d+e x)}{4 e^4 f}+\frac {b n x (d f-e g)^3}{4 e^3}-\frac {b n (f x+g)^2 (d f-e g)^2}{8 e^2 f}+\frac {b n (f x+g)^3 (d f-e g)}{12 e f}-\frac {b n (f x+g)^4}{16 f} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(f + g/x)^3*x^3*(a + b*Log[c*(d + e*x)^n]),x]

[Out]

(b*(d*f - e*g)^3*n*x)/(4*e^3) - (b*(d*f - e*g)^2*n*(g + f*x)^2)/(8*e^2*f) + (b*(d*f - e*g)*n*(g + f*x)^3)/(12*
e*f) - (b*n*(g + f*x)^4)/(16*f) - (b*(d*f - e*g)^4*n*Log[d + e*x])/(4*e^4*f) + ((g + f*x)^4*(a + b*Log[c*(d +
e*x)^n]))/(4*f)

Rule 45

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rule 2442

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))*((f_.) + (g_.)*(x_))^(q_.), x_Symbol] :> Simp[(f + g*
x)^(q + 1)*((a + b*Log[c*(d + e*x)^n])/(g*(q + 1))), x] - Dist[b*e*(n/(g*(q + 1))), Int[(f + g*x)^(q + 1)/(d +
 e*x), x], x] /; FreeQ[{a, b, c, d, e, f, g, n, q}, x] && NeQ[e*f - d*g, 0] && NeQ[q, -1]

Rule 2459

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))^(p_.)*((f_) + (g_.)/(x_))^(q_.)*(x_)^(m_.), x_Symbol]
 :> Int[(g + f*x)^q*(a + b*Log[c*(d + e*x)^n])^p, x] /; FreeQ[{a, b, c, d, e, f, g, m, n, p, q}, x] && EqQ[m,
q] && IntegerQ[q]

Rubi steps

\begin {align*} \int \left (f+\frac {g}{x}\right )^3 x^3 \left (a+b \log \left (c (d+e x)^n\right )\right ) \, dx &=\int (g+f x)^3 \left (a+b \log \left (c (d+e x)^n\right )\right ) \, dx\\ &=\frac {(g+f x)^4 \left (a+b \log \left (c (d+e x)^n\right )\right )}{4 f}-\frac {(b e n) \int \frac {(g+f x)^4}{d+e x} \, dx}{4 f}\\ &=\frac {(g+f x)^4 \left (a+b \log \left (c (d+e x)^n\right )\right )}{4 f}-\frac {(b e n) \int \left (\frac {f (-d f+e g)^3}{e^4}+\frac {(-d f+e g)^4}{e^4 (d+e x)}+\frac {f (-d f+e g)^2 (g+f x)}{e^3}+\frac {f (-d f+e g) (g+f x)^2}{e^2}+\frac {f (g+f x)^3}{e}\right ) \, dx}{4 f}\\ &=\frac {b (d f-e g)^3 n x}{4 e^3}-\frac {b (d f-e g)^2 n (g+f x)^2}{8 e^2 f}+\frac {b (d f-e g) n (g+f x)^3}{12 e f}-\frac {b n (g+f x)^4}{16 f}-\frac {b (d f-e g)^4 n \log (d+e x)}{4 e^4 f}+\frac {(g+f x)^4 \left (a+b \log \left (c (d+e x)^n\right )\right )}{4 f}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.16, size = 226, normalized size = 1.52 \begin {gather*} \frac {e x \left (12 a e^3 \left (4 g^3+6 f g^2 x+4 f^2 g x^2+f^3 x^3\right )+b n \left (12 d^3 f^3-6 d^2 e f^2 (8 g+f x)+4 d e^2 f \left (18 g^2+6 f g x+f^2 x^2\right )-e^3 \left (48 g^3+36 f g^2 x+16 f^2 g x^2+3 f^3 x^3\right )\right )\right )-12 b d^2 f \left (d^2 f^2-4 d e f g+6 e^2 g^2\right ) n \log (d+e x)+12 b e^3 \left (4 d g^3+e x \left (4 g^3+6 f g^2 x+4 f^2 g x^2+f^3 x^3\right )\right ) \log \left (c (d+e x)^n\right )}{48 e^4} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(f + g/x)^3*x^3*(a + b*Log[c*(d + e*x)^n]),x]

[Out]

(e*x*(12*a*e^3*(4*g^3 + 6*f*g^2*x + 4*f^2*g*x^2 + f^3*x^3) + b*n*(12*d^3*f^3 - 6*d^2*e*f^2*(8*g + f*x) + 4*d*e
^2*f*(18*g^2 + 6*f*g*x + f^2*x^2) - e^3*(48*g^3 + 36*f*g^2*x + 16*f^2*g*x^2 + 3*f^3*x^3))) - 12*b*d^2*f*(d^2*f
^2 - 4*d*e*f*g + 6*e^2*g^2)*n*Log[d + e*x] + 12*b*e^3*(4*d*g^3 + e*x*(4*g^3 + 6*f*g^2*x + 4*f^2*g*x^2 + f^3*x^
3))*Log[c*(d + e*x)^n])/(48*e^4)

________________________________________________________________________________________

Maple [C] Result contains higher order function than in optimal. Order 9 vs. order 3.
time = 0.29, size = 836, normalized size = 5.61

method result size
risch \(\frac {a \,f^{3} x^{4}}{4}+x a \,g^{3}+\frac {b \,g^{3} n d \ln \left (e x +d \right )}{e}-b \,g^{3} n x +\frac {i f^{3} \pi b \,x^{4} \mathrm {csgn}\left (i \left (e x +d \right )^{n}\right ) \mathrm {csgn}\left (i c \left (e x +d \right )^{n}\right )^{2}}{8}-\frac {i f^{2} \pi b g \,x^{3} \mathrm {csgn}\left (i c \left (e x +d \right )^{n}\right )^{3}}{2}+\frac {i f^{3} \pi b \,x^{4} \mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i c \left (e x +d \right )^{n}\right )^{2}}{8}-\frac {3 i f \pi b \,g^{2} x^{2} \mathrm {csgn}\left (i c \left (e x +d \right )^{n}\right )^{3}}{4}+\frac {f^{3} \ln \left (c \right ) b \,x^{4}}{4}+\ln \left (c \right ) b \,g^{3} x +\frac {3 f a \,g^{2} x^{2}}{2}-\frac {f^{3} b n \,x^{4}}{16}+f^{2} a g \,x^{3}+\frac {3 f \ln \left (c \right ) b \,g^{2} x^{2}}{2}-\frac {\ln \left (e x +d \right ) b \,g^{4} n}{4 f}+f^{2} \ln \left (c \right ) b g \,x^{3}+\frac {i \pi b \,g^{3} x \,\mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i c \left (e x +d \right )^{n}\right )^{2}}{2}+\frac {i \pi b \,g^{3} x \,\mathrm {csgn}\left (i \left (e x +d \right )^{n}\right ) \mathrm {csgn}\left (i c \left (e x +d \right )^{n}\right )^{2}}{2}+\frac {f^{2} b d g n \,x^{2}}{2 e}-\frac {f^{2} b \,d^{2} g n x}{e^{2}}+\frac {3 f b d \,g^{2} n x}{2 e}-\frac {3 f \ln \left (e x +d \right ) b \,d^{2} g^{2} n}{2 e^{2}}+\frac {f^{2} \ln \left (e x +d \right ) b \,d^{3} g n}{e^{3}}+\frac {\left (f x +g \right )^{4} b \ln \left (\left (e x +d \right )^{n}\right )}{4 f}-\frac {3 i f \pi b \,g^{2} x^{2} \mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i \left (e x +d \right )^{n}\right ) \mathrm {csgn}\left (i c \left (e x +d \right )^{n}\right )}{4}-\frac {i f^{2} \pi b g \,x^{3} \mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i \left (e x +d \right )^{n}\right ) \mathrm {csgn}\left (i c \left (e x +d \right )^{n}\right )}{2}-\frac {f^{3} \ln \left (e x +d \right ) b \,d^{4} n}{4 e^{4}}+\frac {f^{3} b d n \,x^{3}}{12 e}-\frac {f^{2} b g n \,x^{3}}{3}-\frac {f^{3} b \,d^{2} n \,x^{2}}{8 e^{2}}-\frac {i f^{3} \pi b \,x^{4} \mathrm {csgn}\left (i c \left (e x +d \right )^{n}\right )^{3}}{8}-\frac {i \pi b \,g^{3} x \,\mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i \left (e x +d \right )^{n}\right ) \mathrm {csgn}\left (i c \left (e x +d \right )^{n}\right )}{2}-\frac {3 f b \,g^{2} n \,x^{2}}{4}-\frac {i \pi b \,g^{3} x \mathrm {csgn}\left (i c \left (e x +d \right )^{n}\right )^{3}}{2}+\frac {i f^{2} \pi b g \,x^{3} \mathrm {csgn}\left (i \left (e x +d \right )^{n}\right ) \mathrm {csgn}\left (i c \left (e x +d \right )^{n}\right )^{2}}{2}+\frac {3 i f \pi b \,g^{2} x^{2} \mathrm {csgn}\left (i \left (e x +d \right )^{n}\right ) \mathrm {csgn}\left (i c \left (e x +d \right )^{n}\right )^{2}}{4}+\frac {3 i f \pi b \,g^{2} x^{2} \mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i c \left (e x +d \right )^{n}\right )^{2}}{4}+\frac {i f^{2} \pi b g \,x^{3} \mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i c \left (e x +d \right )^{n}\right )^{2}}{2}-\frac {i f^{3} \pi b \,x^{4} \mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i \left (e x +d \right )^{n}\right ) \mathrm {csgn}\left (i c \left (e x +d \right )^{n}\right )}{8}+\frac {f^{3} b \,d^{3} n x}{4 e^{3}}\) \(836\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((f+g/x)^3*x^3*(a+b*ln(c*(e*x+d)^n)),x,method=_RETURNVERBOSE)

[Out]

1/4*a*f^3*x^4+x*a*g^3+b*g^3/e*n*d*ln(e*x+d)-b*g^3*n*x+1/4*f^3*ln(c)*b*x^4+ln(c)*b*g^3*x+3/2*f*a*g^2*x^2-1/16*f
^3*b*n*x^4+f^2*a*g*x^3+3/2*f*ln(c)*b*g^2*x^2-1/4/f*ln(e*x+d)*b*g^4*n+f^2*ln(c)*b*g*x^3+1/8*I*f^3*Pi*b*x^4*csgn
(I*(e*x+d)^n)*csgn(I*c*(e*x+d)^n)^2-1/2*I*f^2*Pi*b*g*x^3*csgn(I*c*(e*x+d)^n)^3+1/2/e*f^2*b*d*g*n*x^2-1/e^2*f^2
*b*d^2*g*n*x+3/2/e*f*b*d*g^2*n*x-3/2/e^2*f*ln(e*x+d)*b*d^2*g^2*n+1/e^3*f^2*ln(e*x+d)*b*d^3*g*n+1/8*I*f^3*Pi*b*
x^4*csgn(I*c)*csgn(I*c*(e*x+d)^n)^2-3/4*I*f*Pi*b*g^2*x^2*csgn(I*c*(e*x+d)^n)^3+1/2*I*Pi*b*g^3*x*csgn(I*c)*csgn
(I*c*(e*x+d)^n)^2+1/2*I*Pi*b*g^3*x*csgn(I*(e*x+d)^n)*csgn(I*c*(e*x+d)^n)^2+1/4*(f*x+g)^4*b/f*ln((e*x+d)^n)-3/4
*I*f*Pi*b*g^2*x^2*csgn(I*c)*csgn(I*(e*x+d)^n)*csgn(I*c*(e*x+d)^n)-1/2*I*f^2*Pi*b*g*x^3*csgn(I*c)*csgn(I*(e*x+d
)^n)*csgn(I*c*(e*x+d)^n)-1/4/e^4*f^3*ln(e*x+d)*b*d^4*n-1/8*I*f^3*Pi*b*x^4*csgn(I*c*(e*x+d)^n)^3-1/2*I*Pi*b*g^3
*x*csgn(I*c*(e*x+d)^n)^3+1/12/e*f^3*b*d*n*x^3-1/3*f^2*b*g*n*x^3-1/8/e^2*f^3*b*d^2*n*x^2-3/4*f*b*g^2*n*x^2-1/2*
I*Pi*b*g^3*x*csgn(I*c)*csgn(I*(e*x+d)^n)*csgn(I*c*(e*x+d)^n)+1/2*I*f^2*Pi*b*g*x^3*csgn(I*(e*x+d)^n)*csgn(I*c*(
e*x+d)^n)^2+3/4*I*f*Pi*b*g^2*x^2*csgn(I*(e*x+d)^n)*csgn(I*c*(e*x+d)^n)^2+3/4*I*f*Pi*b*g^2*x^2*csgn(I*c)*csgn(I
*c*(e*x+d)^n)^2+1/2*I*f^2*Pi*b*g*x^3*csgn(I*c)*csgn(I*c*(e*x+d)^n)^2-1/8*I*f^3*Pi*b*x^4*csgn(I*c)*csgn(I*(e*x+
d)^n)*csgn(I*c*(e*x+d)^n)+1/4/e^3*f^3*b*d^3*n*x

________________________________________________________________________________________

Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 287 vs. \(2 (139) = 278\).
time = 0.28, size = 287, normalized size = 1.93 \begin {gather*} \frac {1}{4} \, b f^{3} x^{4} \log \left ({\left (x e + d\right )}^{n} c\right ) + \frac {1}{4} \, a f^{3} x^{4} + b f^{2} g x^{3} \log \left ({\left (x e + d\right )}^{n} c\right ) + a f^{2} g x^{3} - \frac {1}{48} \, {\left (12 \, d^{4} e^{\left (-5\right )} \log \left (x e + d\right ) + {\left (3 \, x^{4} e^{3} - 4 \, d x^{3} e^{2} + 6 \, d^{2} x^{2} e - 12 \, d^{3} x\right )} e^{\left (-4\right )}\right )} b f^{3} n e + \frac {1}{6} \, {\left (6 \, d^{3} e^{\left (-4\right )} \log \left (x e + d\right ) - {\left (2 \, x^{3} e^{2} - 3 \, d x^{2} e + 6 \, d^{2} x\right )} e^{\left (-3\right )}\right )} b f^{2} g n e - \frac {3}{4} \, {\left (2 \, d^{2} e^{\left (-3\right )} \log \left (x e + d\right ) + {\left (x^{2} e - 2 \, d x\right )} e^{\left (-2\right )}\right )} b f g^{2} n e + {\left (d e^{\left (-2\right )} \log \left (x e + d\right ) - x e^{\left (-1\right )}\right )} b g^{3} n e + \frac {3}{2} \, b f g^{2} x^{2} \log \left ({\left (x e + d\right )}^{n} c\right ) + \frac {3}{2} \, a f g^{2} x^{2} + b g^{3} x \log \left ({\left (x e + d\right )}^{n} c\right ) + a g^{3} x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((f+g/x)^3*x^3*(a+b*log(c*(e*x+d)^n)),x, algorithm="maxima")

[Out]

1/4*b*f^3*x^4*log((x*e + d)^n*c) + 1/4*a*f^3*x^4 + b*f^2*g*x^3*log((x*e + d)^n*c) + a*f^2*g*x^3 - 1/48*(12*d^4
*e^(-5)*log(x*e + d) + (3*x^4*e^3 - 4*d*x^3*e^2 + 6*d^2*x^2*e - 12*d^3*x)*e^(-4))*b*f^3*n*e + 1/6*(6*d^3*e^(-4
)*log(x*e + d) - (2*x^3*e^2 - 3*d*x^2*e + 6*d^2*x)*e^(-3))*b*f^2*g*n*e - 3/4*(2*d^2*e^(-3)*log(x*e + d) + (x^2
*e - 2*d*x)*e^(-2))*b*f*g^2*n*e + (d*e^(-2)*log(x*e + d) - x*e^(-1))*b*g^3*n*e + 3/2*b*f*g^2*x^2*log((x*e + d)
^n*c) + 3/2*a*f*g^2*x^2 + b*g^3*x*log((x*e + d)^n*c) + a*g^3*x

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 304 vs. \(2 (139) = 278\).
time = 0.36, size = 304, normalized size = 2.04 \begin {gather*} \frac {1}{48} \, {\left (12 \, b d^{3} f^{3} n x e + 12 \, {\left (b f^{3} x^{4} + 4 \, b f^{2} g x^{3} + 6 \, b f g^{2} x^{2} + 4 \, b g^{3} x\right )} e^{4} \log \left (c\right ) - {\left (3 \, {\left (b f^{3} n - 4 \, a f^{3}\right )} x^{4} + 16 \, {\left (b f^{2} g n - 3 \, a f^{2} g\right )} x^{3} + 36 \, {\left (b f g^{2} n - 2 \, a f g^{2}\right )} x^{2} + 48 \, {\left (b g^{3} n - a g^{3}\right )} x\right )} e^{4} + 4 \, {\left (b d f^{3} n x^{3} + 6 \, b d f^{2} g n x^{2} + 18 \, b d f g^{2} n x\right )} e^{3} - 6 \, {\left (b d^{2} f^{3} n x^{2} + 8 \, b d^{2} f^{2} g n x\right )} e^{2} - 12 \, {\left (b d^{4} f^{3} n - 4 \, b d^{3} f^{2} g n e + 6 \, b d^{2} f g^{2} n e^{2} - 4 \, b d g^{3} n e^{3} - {\left (b f^{3} n x^{4} + 4 \, b f^{2} g n x^{3} + 6 \, b f g^{2} n x^{2} + 4 \, b g^{3} n x\right )} e^{4}\right )} \log \left (x e + d\right )\right )} e^{\left (-4\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((f+g/x)^3*x^3*(a+b*log(c*(e*x+d)^n)),x, algorithm="fricas")

[Out]

1/48*(12*b*d^3*f^3*n*x*e + 12*(b*f^3*x^4 + 4*b*f^2*g*x^3 + 6*b*f*g^2*x^2 + 4*b*g^3*x)*e^4*log(c) - (3*(b*f^3*n
 - 4*a*f^3)*x^4 + 16*(b*f^2*g*n - 3*a*f^2*g)*x^3 + 36*(b*f*g^2*n - 2*a*f*g^2)*x^2 + 48*(b*g^3*n - a*g^3)*x)*e^
4 + 4*(b*d*f^3*n*x^3 + 6*b*d*f^2*g*n*x^2 + 18*b*d*f*g^2*n*x)*e^3 - 6*(b*d^2*f^3*n*x^2 + 8*b*d^2*f^2*g*n*x)*e^2
 - 12*(b*d^4*f^3*n - 4*b*d^3*f^2*g*n*e + 6*b*d^2*f*g^2*n*e^2 - 4*b*d*g^3*n*e^3 - (b*f^3*n*x^4 + 4*b*f^2*g*n*x^
3 + 6*b*f*g^2*n*x^2 + 4*b*g^3*n*x)*e^4)*log(x*e + d))*e^(-4)

________________________________________________________________________________________

Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 410 vs. \(2 (128) = 256\).
time = 26.99, size = 410, normalized size = 2.75 \begin {gather*} \begin {cases} \frac {a f^{3} x^{4}}{4} + a f^{2} g x^{3} + \frac {3 a f g^{2} x^{2}}{2} + a g^{3} x - \frac {b d^{4} f^{3} \log {\left (c \left (d + e x\right )^{n} \right )}}{4 e^{4}} + \frac {b d^{3} f^{3} n x}{4 e^{3}} + \frac {b d^{3} f^{2} g \log {\left (c \left (d + e x\right )^{n} \right )}}{e^{3}} - \frac {b d^{2} f^{3} n x^{2}}{8 e^{2}} - \frac {b d^{2} f^{2} g n x}{e^{2}} - \frac {3 b d^{2} f g^{2} \log {\left (c \left (d + e x\right )^{n} \right )}}{2 e^{2}} + \frac {b d f^{3} n x^{3}}{12 e} + \frac {b d f^{2} g n x^{2}}{2 e} + \frac {3 b d f g^{2} n x}{2 e} + \frac {b d g^{3} \log {\left (c \left (d + e x\right )^{n} \right )}}{e} - \frac {b f^{3} n x^{4}}{16} + \frac {b f^{3} x^{4} \log {\left (c \left (d + e x\right )^{n} \right )}}{4} - \frac {b f^{2} g n x^{3}}{3} + b f^{2} g x^{3} \log {\left (c \left (d + e x\right )^{n} \right )} - \frac {3 b f g^{2} n x^{2}}{4} + \frac {3 b f g^{2} x^{2} \log {\left (c \left (d + e x\right )^{n} \right )}}{2} - b g^{3} n x + b g^{3} x \log {\left (c \left (d + e x\right )^{n} \right )} & \text {for}\: e \neq 0 \\\left (a + b \log {\left (c d^{n} \right )}\right ) \left (\frac {f^{3} x^{4}}{4} + f^{2} g x^{3} + \frac {3 f g^{2} x^{2}}{2} + g^{3} x\right ) & \text {otherwise} \end {cases} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((f+g/x)**3*x**3*(a+b*ln(c*(e*x+d)**n)),x)

[Out]

Piecewise((a*f**3*x**4/4 + a*f**2*g*x**3 + 3*a*f*g**2*x**2/2 + a*g**3*x - b*d**4*f**3*log(c*(d + e*x)**n)/(4*e
**4) + b*d**3*f**3*n*x/(4*e**3) + b*d**3*f**2*g*log(c*(d + e*x)**n)/e**3 - b*d**2*f**3*n*x**2/(8*e**2) - b*d**
2*f**2*g*n*x/e**2 - 3*b*d**2*f*g**2*log(c*(d + e*x)**n)/(2*e**2) + b*d*f**3*n*x**3/(12*e) + b*d*f**2*g*n*x**2/
(2*e) + 3*b*d*f*g**2*n*x/(2*e) + b*d*g**3*log(c*(d + e*x)**n)/e - b*f**3*n*x**4/16 + b*f**3*x**4*log(c*(d + e*
x)**n)/4 - b*f**2*g*n*x**3/3 + b*f**2*g*x**3*log(c*(d + e*x)**n) - 3*b*f*g**2*n*x**2/4 + 3*b*f*g**2*x**2*log(c
*(d + e*x)**n)/2 - b*g**3*n*x + b*g**3*x*log(c*(d + e*x)**n), Ne(e, 0)), ((a + b*log(c*d**n))*(f**3*x**4/4 + f
**2*g*x**3 + 3*f*g**2*x**2/2 + g**3*x), True))

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 780 vs. \(2 (139) = 278\).
time = 4.80, size = 780, normalized size = 5.23 \begin {gather*} \frac {1}{4} \, {\left (x e + d\right )}^{4} b f^{3} n e^{\left (-4\right )} \log \left (x e + d\right ) - {\left (x e + d\right )}^{3} b d f^{3} n e^{\left (-4\right )} \log \left (x e + d\right ) + \frac {3}{2} \, {\left (x e + d\right )}^{2} b d^{2} f^{3} n e^{\left (-4\right )} \log \left (x e + d\right ) - {\left (x e + d\right )} b d^{3} f^{3} n e^{\left (-4\right )} \log \left (x e + d\right ) - \frac {1}{16} \, {\left (x e + d\right )}^{4} b f^{3} n e^{\left (-4\right )} + \frac {1}{3} \, {\left (x e + d\right )}^{3} b d f^{3} n e^{\left (-4\right )} - \frac {3}{4} \, {\left (x e + d\right )}^{2} b d^{2} f^{3} n e^{\left (-4\right )} + {\left (x e + d\right )} b d^{3} f^{3} n e^{\left (-4\right )} + {\left (x e + d\right )}^{3} b f^{2} g n e^{\left (-3\right )} \log \left (x e + d\right ) - 3 \, {\left (x e + d\right )}^{2} b d f^{2} g n e^{\left (-3\right )} \log \left (x e + d\right ) + 3 \, {\left (x e + d\right )} b d^{2} f^{2} g n e^{\left (-3\right )} \log \left (x e + d\right ) + \frac {1}{4} \, {\left (x e + d\right )}^{4} b f^{3} e^{\left (-4\right )} \log \left (c\right ) - {\left (x e + d\right )}^{3} b d f^{3} e^{\left (-4\right )} \log \left (c\right ) + \frac {3}{2} \, {\left (x e + d\right )}^{2} b d^{2} f^{3} e^{\left (-4\right )} \log \left (c\right ) - {\left (x e + d\right )} b d^{3} f^{3} e^{\left (-4\right )} \log \left (c\right ) - \frac {1}{3} \, {\left (x e + d\right )}^{3} b f^{2} g n e^{\left (-3\right )} + \frac {3}{2} \, {\left (x e + d\right )}^{2} b d f^{2} g n e^{\left (-3\right )} - 3 \, {\left (x e + d\right )} b d^{2} f^{2} g n e^{\left (-3\right )} + \frac {1}{4} \, {\left (x e + d\right )}^{4} a f^{3} e^{\left (-4\right )} - {\left (x e + d\right )}^{3} a d f^{3} e^{\left (-4\right )} + \frac {3}{2} \, {\left (x e + d\right )}^{2} a d^{2} f^{3} e^{\left (-4\right )} - {\left (x e + d\right )} a d^{3} f^{3} e^{\left (-4\right )} + \frac {3}{2} \, {\left (x e + d\right )}^{2} b f g^{2} n e^{\left (-2\right )} \log \left (x e + d\right ) - 3 \, {\left (x e + d\right )} b d f g^{2} n e^{\left (-2\right )} \log \left (x e + d\right ) + {\left (x e + d\right )}^{3} b f^{2} g e^{\left (-3\right )} \log \left (c\right ) - 3 \, {\left (x e + d\right )}^{2} b d f^{2} g e^{\left (-3\right )} \log \left (c\right ) + 3 \, {\left (x e + d\right )} b d^{2} f^{2} g e^{\left (-3\right )} \log \left (c\right ) - \frac {3}{4} \, {\left (x e + d\right )}^{2} b f g^{2} n e^{\left (-2\right )} + 3 \, {\left (x e + d\right )} b d f g^{2} n e^{\left (-2\right )} + {\left (x e + d\right )}^{3} a f^{2} g e^{\left (-3\right )} - 3 \, {\left (x e + d\right )}^{2} a d f^{2} g e^{\left (-3\right )} + 3 \, {\left (x e + d\right )} a d^{2} f^{2} g e^{\left (-3\right )} + {\left (x e + d\right )} b g^{3} n e^{\left (-1\right )} \log \left (x e + d\right ) + \frac {3}{2} \, {\left (x e + d\right )}^{2} b f g^{2} e^{\left (-2\right )} \log \left (c\right ) - 3 \, {\left (x e + d\right )} b d f g^{2} e^{\left (-2\right )} \log \left (c\right ) - {\left (x e + d\right )} b g^{3} n e^{\left (-1\right )} + \frac {3}{2} \, {\left (x e + d\right )}^{2} a f g^{2} e^{\left (-2\right )} - 3 \, {\left (x e + d\right )} a d f g^{2} e^{\left (-2\right )} + {\left (x e + d\right )} b g^{3} e^{\left (-1\right )} \log \left (c\right ) + {\left (x e + d\right )} a g^{3} e^{\left (-1\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((f+g/x)^3*x^3*(a+b*log(c*(e*x+d)^n)),x, algorithm="giac")

[Out]

1/4*(x*e + d)^4*b*f^3*n*e^(-4)*log(x*e + d) - (x*e + d)^3*b*d*f^3*n*e^(-4)*log(x*e + d) + 3/2*(x*e + d)^2*b*d^
2*f^3*n*e^(-4)*log(x*e + d) - (x*e + d)*b*d^3*f^3*n*e^(-4)*log(x*e + d) - 1/16*(x*e + d)^4*b*f^3*n*e^(-4) + 1/
3*(x*e + d)^3*b*d*f^3*n*e^(-4) - 3/4*(x*e + d)^2*b*d^2*f^3*n*e^(-4) + (x*e + d)*b*d^3*f^3*n*e^(-4) + (x*e + d)
^3*b*f^2*g*n*e^(-3)*log(x*e + d) - 3*(x*e + d)^2*b*d*f^2*g*n*e^(-3)*log(x*e + d) + 3*(x*e + d)*b*d^2*f^2*g*n*e
^(-3)*log(x*e + d) + 1/4*(x*e + d)^4*b*f^3*e^(-4)*log(c) - (x*e + d)^3*b*d*f^3*e^(-4)*log(c) + 3/2*(x*e + d)^2
*b*d^2*f^3*e^(-4)*log(c) - (x*e + d)*b*d^3*f^3*e^(-4)*log(c) - 1/3*(x*e + d)^3*b*f^2*g*n*e^(-3) + 3/2*(x*e + d
)^2*b*d*f^2*g*n*e^(-3) - 3*(x*e + d)*b*d^2*f^2*g*n*e^(-3) + 1/4*(x*e + d)^4*a*f^3*e^(-4) - (x*e + d)^3*a*d*f^3
*e^(-4) + 3/2*(x*e + d)^2*a*d^2*f^3*e^(-4) - (x*e + d)*a*d^3*f^3*e^(-4) + 3/2*(x*e + d)^2*b*f*g^2*n*e^(-2)*log
(x*e + d) - 3*(x*e + d)*b*d*f*g^2*n*e^(-2)*log(x*e + d) + (x*e + d)^3*b*f^2*g*e^(-3)*log(c) - 3*(x*e + d)^2*b*
d*f^2*g*e^(-3)*log(c) + 3*(x*e + d)*b*d^2*f^2*g*e^(-3)*log(c) - 3/4*(x*e + d)^2*b*f*g^2*n*e^(-2) + 3*(x*e + d)
*b*d*f*g^2*n*e^(-2) + (x*e + d)^3*a*f^2*g*e^(-3) - 3*(x*e + d)^2*a*d*f^2*g*e^(-3) + 3*(x*e + d)*a*d^2*f^2*g*e^
(-3) + (x*e + d)*b*g^3*n*e^(-1)*log(x*e + d) + 3/2*(x*e + d)^2*b*f*g^2*e^(-2)*log(c) - 3*(x*e + d)*b*d*f*g^2*e
^(-2)*log(c) - (x*e + d)*b*g^3*n*e^(-1) + 3/2*(x*e + d)^2*a*f*g^2*e^(-2) - 3*(x*e + d)*a*d*f*g^2*e^(-2) + (x*e
 + d)*b*g^3*e^(-1)*log(c) + (x*e + d)*a*g^3*e^(-1)

________________________________________________________________________________________

Mupad [B]
time = 0.37, size = 352, normalized size = 2.36 \begin {gather*} x\,\left (\frac {4\,a\,e\,g^3+12\,a\,d\,f\,g^2-4\,b\,e\,g^3\,n}{4\,e}+\frac {d\,\left (\frac {d\,\left (\frac {f^2\,\left (a\,d\,f+3\,a\,e\,g-b\,e\,g\,n\right )}{e}-\frac {d\,f^3\,\left (4\,a-b\,n\right )}{4\,e}\right )}{e}-\frac {3\,f\,g\,\left (2\,a\,d\,f+2\,a\,e\,g-b\,e\,g\,n\right )}{2\,e}\right )}{e}\right )+x^3\,\left (\frac {f^2\,\left (a\,d\,f+3\,a\,e\,g-b\,e\,g\,n\right )}{3\,e}-\frac {d\,f^3\,\left (4\,a-b\,n\right )}{12\,e}\right )+\ln \left (c\,{\left (d+e\,x\right )}^n\right )\,\left (\frac {b\,f^3\,x^4}{4}+b\,f^2\,g\,x^3+\frac {3\,b\,f\,g^2\,x^2}{2}+b\,g^3\,x\right )-x^2\,\left (\frac {d\,\left (\frac {f^2\,\left (a\,d\,f+3\,a\,e\,g-b\,e\,g\,n\right )}{e}-\frac {d\,f^3\,\left (4\,a-b\,n\right )}{4\,e}\right )}{2\,e}-\frac {3\,f\,g\,\left (2\,a\,d\,f+2\,a\,e\,g-b\,e\,g\,n\right )}{4\,e}\right )-\frac {\ln \left (d+e\,x\right )\,\left (b\,n\,d^4\,f^3-4\,b\,n\,d^3\,e\,f^2\,g+6\,b\,n\,d^2\,e^2\,f\,g^2-4\,b\,n\,d\,e^3\,g^3\right )}{4\,e^4}+\frac {f^3\,x^4\,\left (4\,a-b\,n\right )}{16} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x^3*(f + g/x)^3*(a + b*log(c*(d + e*x)^n)),x)

[Out]

x*((4*a*e*g^3 + 12*a*d*f*g^2 - 4*b*e*g^3*n)/(4*e) + (d*((d*((f^2*(a*d*f + 3*a*e*g - b*e*g*n))/e - (d*f^3*(4*a
- b*n))/(4*e)))/e - (3*f*g*(2*a*d*f + 2*a*e*g - b*e*g*n))/(2*e)))/e) + x^3*((f^2*(a*d*f + 3*a*e*g - b*e*g*n))/
(3*e) - (d*f^3*(4*a - b*n))/(12*e)) + log(c*(d + e*x)^n)*((b*f^3*x^4)/4 + b*g^3*x + (3*b*f*g^2*x^2)/2 + b*f^2*
g*x^3) - x^2*((d*((f^2*(a*d*f + 3*a*e*g - b*e*g*n))/e - (d*f^3*(4*a - b*n))/(4*e)))/(2*e) - (3*f*g*(2*a*d*f +
2*a*e*g - b*e*g*n))/(4*e)) - (log(d + e*x)*(b*d^4*f^3*n - 4*b*d*e^3*g^3*n - 4*b*d^3*e*f^2*g*n + 6*b*d^2*e^2*f*
g^2*n))/(4*e^4) + (f^3*x^4*(4*a - b*n))/16

________________________________________________________________________________________